package com.jirong.shop.config;

import com.jirong.shop.pojo.TUser;

public class UserContext {
    //    利用本地线程存储用户类
    private static ThreadLocal<TUser> userHolder = new ThreadLocal<>();

    public static void setUser(TUser user) {
        userHolder.set(user);
    }

    public static TUser getUser() {
        return userHolder.get();
    }
}